package edu.cuit.campus.admin.service.bean;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import edu.cuit.campus.admin.service.CompanyService;
import edu.cuit.campus.entity.po.Company;
import edu.cuit.campus.repository.common.MybatisHelper;
import edu.cuit.campus.repository.mapper.CompanyMapper;

/**
 * @author <a href="mailto:1020zhaodan@163.com">Adan</a>
 * @version 1.0
 * @date 2025/8/11 16:03
 */
public class CompanyServiceBean implements CompanyService {
    @Override
    public PageInfo<Company> list(int pageIndex, int pageSize) {
        PageHelper.startPage(pageIndex, pageSize);
        var session = MybatisHelper.openSession();
        var mapper = session.getMapper(CompanyMapper.class);
        var result = mapper.limit();
        MybatisHelper.close();
        return new PageInfo<>(result);
    }
}
